package com.example.springbootlucenedemo.bean;

import com.example.springbootlucenedemo.common.lucene.annotation.*;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.Data;
import org.apache.lucene.document.Field;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;

@Data
@Entity
@Table(name = "tb_mission")
@LuceneIndexPath("tb_mission")
@JsonIgnoreProperties(value = {"hibernateLazyInitializer","handler"})
public class TbMission implements Serializable {

    @Id
    @Primarykey
    @LongPoint(fieldStore = Field.Store.YES)
    private Long mission_id;
    /**
     * 项目内容
     */
    @Column
    @TextField(fieldStore = Field.Store.NO)
    private String detail_info;
    /**
     * 项目主题
     */
    @Column
    @TextField(fieldStore = Field.Store.NO)
    private String subject;

    @Column
    @DateField(fieldStore = Field.Store.YES)
    private Date create_datetime;

    /**
     * 项目状态(对应状态表)
     */
    @LongPoint(fieldStore = Field.Store.YES)
    private long state;

    /**
     * 组织
     */
    @TextField(fieldStore = Field.Store.YES)
    @Transient
    private String  rperm_code;
    /**
     * 行政区域
     */
    @TextField(fieldStore = Field.Store.YES)
    @Transient
    private String  perm_code;

    /**
     * 美丽乡村项目 1 是
     */
    @StringField(fieldStore = Field.Store.YES)
    @Transient
    private String is_apply;

    /**
     * 活动类型
     */
    @StringField(fieldStore = Field.Store.YES)
    private String mission_type;

    //是否亲子项目(1:是 0:否 )
    @StringField(fieldStore = Field.Store.YES)
    @Transient
    private String is_parent_chile;
    /**
     * 浏览量
     */
    @LongPoint(fieldStore = Field.Store.YES)
    private Long browse_count;

    @Column
    @DateField(fieldStore = Field.Store.YES)
    private Date start_date;
}
